import 'package:casdon/core/logger/log.dart';
import 'package:casdon/core/network/business_exception.dart';
import 'package:casdon/modules/lifeCircle/data/repository/life_repository.dart';

class LifeDelCommentUsecase {
  final LifeRepository _repository;

  const LifeDelCommentUsecase(this._repository);

  Future<void> execute({required String id}) async {
    try {
      await _repository.delComment(id: id);
    } on BusinessException {
      rethrow;
    } catch (e, st) {
      Log.e('LifeDelCommentUsecase 失败', e.toString(), st);
      throw Exception('删除评论失败');
    }
  }
}
